{extend name="base" /} {block name="body"}
<div class="layui-body">
	<div class="navbar">
		<a><cite>代理管理</cite></a>&nbsp;<span class="layui-box">&gt;</span>
		<a href=""><cite>订单列表</cite></a>
	</div>
	<!--tab标签-->
	<div class="layui-tab layui-tab-brief">
		<form class="layui-form layui-form-pane" action="" method="get">
		<blockquote class="layui-elem-quote">
			<div class="layui-inline">
				<div class="layui-input-inline">
					<input type="text" name="order_sn" value="{$order_sn}" placeholder="订单编号" class="layui-input">
				</div>
			</div>
			<div class="layui-inline">
				<div class="layui-input-inline">
					<input type="text" name="agent_name" value="{$agent_name}" placeholder="商家名称" class="layui-input">
				</div>
			</div>
			<div class="layui-inline">
				<select name="status">
					<option value="0">订单状态</option>
					<option value="1" {if $status=='1' }selected{/if}>待付款</option>
					<option value="2" {if $status=='2' }selected{/if}>待发货</option>
					<option value="3" {if $status=='3' }selected{/if}>待收货</option>
					<option value="4" {if $status=='4' }selected{/if}>待评价</option>
					<option value="5" {if $status=='5' }selected{/if}>已完成</option>
					<option value="6" {if $status=='6' }selected{/if}>已预定</option>
					<option value="9" {if $status=='9' }selected{/if}>已关闭</option>
				</select>
			</div>
			<a class="layui-btn search_btn"><i class="fa fa-search"></i> 查询</a>
		</blockquote>
		</form>
		<div class="layui-tab-content">
			<table class="layui-table layui-form">
				<thead>
					<tr>
						<th>商品</th>	                        	
                    	<th>商家</th>
                        <th>单价/数量</th>
                        <th>用户支付</th>
						<th>买家</th>
                        <th>下单时间</th>
                        <th>订单状态</th>
                        <th>实付金额</th>
					</tr>
				</thead>
				<tbody>
						{foreach name="list1" item='order'}
                        	<tr><td colspan="8">订单号:{$order.order_sn}
                        	</td></tr>
                        	<tr><td colspan="8">备注:{$order.memo}</td></tr>
                        	{foreach name="order['items']" item="ad" key="k" }
                        	<tr>
                        		<td><img src="{$ad.thumb}"  width="50px"/>{$ad.goods_name}</td>
                        		<td>{$order.agent_name}</td>
                        		<td>{$ad.price}<br>{$ad.nums}</td>
                        		<td>{$ad.total_price}</td>
                        		<td>{$order.consignee}</td>
                        		<td>{$ad.add_time}</td>
                        		{if condition="$k==0"}
                        			<td rowspan="<?php echo count($order['items']) ?>">
                        			{$order.status|get_order_type}
                        			</td>
                        			<td rowspan="<?php echo count($order['items']) ?>">
                        			{$order.pay_price}
                        			</td>                      			
                        		{/if}
                        	</tr>
                        	{/foreach}
                        	{/foreach}
				</tbody>
			</table>
			{$list->render()}
		</div>
	</div>
</div>
{/block}
{block name="js"}
<script>
	var GV = {
		current_controller: "shop/orders"
	};
</script>
{/block}